3.3.62 \(\int \frac {\cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx\) [262]

Optimal. Leaf size=22 \[ \frac {x}{a}-\frac {i \cosh (c+d x)}{a d} \]

[Out]

x/a-I*cosh(d*x+c)/a/d

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {2761, 8} \begin {gather*} \frac {x}{a}-\frac {i \cosh (c+d x)}{a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cosh[c + d*x]^2/(a + I*a*Sinh[c + d*x]),x]

[Out]

x/a - (I*Cosh[c + d*x])/(a*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2761

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[g*((g*Cos[e
 + f*x])^(p - 1)/(b*f*(p - 1))), x] + Dist[g^2/a, Int[(g*Cos[e + f*x])^(p - 2), x], x] /; FreeQ[{a, b, e, f, g
}, x] && EqQ[a^2 - b^2, 0] && GtQ[p, 1] && IntegerQ[2*p]

Rubi steps

\begin {align*} \int \frac {\cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx &=-\frac {i \cosh (c+d x)}{a d}+\frac {\int 1 \, dx}{a}\\ &=\frac {x}{a}-\frac {i \cosh (c+d x)}{a d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(139\) vs. \(2(22)=44\).
time = 0.12, size = 139, normalized size = 6.32 \begin {gather*} \frac {\cosh ^3(c+d x) \left (-2 \text {ArcSin}\left (\frac {\sqrt {1-i \sinh (c+d x)}}{\sqrt {2}}\right ) \sqrt {1-i \sinh (c+d x)}+\sqrt {1+i \sinh (c+d x)}-i \sqrt {1+i \sinh (c+d x)} \sinh (c+d x)\right )}{a d \sqrt {1+i \sinh (c+d x)} (-i+\sinh (c+d x)) (i+\sinh (c+d x))^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cosh[c + d*x]^2/(a + I*a*Sinh[c + d*x]),x]

[Out]

(Cosh[c + d*x]^3*(-2*ArcSin[Sqrt[1 - I*Sinh[c + d*x]]/Sqrt[2]]*Sqrt[1 - I*Sinh[c + d*x]] + Sqrt[1 + I*Sinh[c +
 d*x]] - I*Sqrt[1 + I*Sinh[c + d*x]]*Sinh[c + d*x]))/(a*d*Sqrt[1 + I*Sinh[c + d*x]]*(-I + Sinh[c + d*x])*(I +
Sinh[c + d*x])^2)

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 69 vs. \(2 (21 ) = 42\).
time = 1.11, size = 70, normalized size = 3.18

method result size
risch \(\frac {x}{a}-\frac {i {\mathrm e}^{d x +c}}{2 a d}-\frac {i {\mathrm e}^{-d x -c}}{2 a d}\) \(40\)
derivativedivides \(\frac {\frac {2 i}{2 \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-2}-\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-\frac {i}{\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1}+\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a d}\) \(70\)
default \(\frac {\frac {2 i}{2 \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-2}-\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-\frac {i}{\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1}+\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a d}\) \(70\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cosh(d*x+c)^2/(a+I*a*sinh(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

2/d/a*(1/2*I/(tanh(1/2*d*x+1/2*c)-1)-1/2*ln(tanh(1/2*d*x+1/2*c)-1)-1/2*I/(tanh(1/2*d*x+1/2*c)+1)+1/2*ln(tanh(1
/2*d*x+1/2*c)+1))

________________________________________________________________________________________

Maxima [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 44 vs. \(2 (20) = 40\).
time = 0.27, size = 44, normalized size = 2.00 \begin {gather*} \frac {d x + c}{a d} - \frac {i \, e^{\left (d x + c\right )}}{2 \, a d} - \frac {i \, e^{\left (-d x - c\right )}}{2 \, a d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(d*x+c)^2/(a+I*a*sinh(d*x+c)),x, algorithm="maxima")

[Out]

(d*x + c)/(a*d) - 1/2*I*e^(d*x + c)/(a*d) - 1/2*I*e^(-d*x - c)/(a*d)

________________________________________________________________________________________

Fricas [A]
time = 0.33, size = 40, normalized size = 1.82 \begin {gather*} \frac {{\left (2 \, d x e^{\left (d x + c\right )} - i \, e^{\left (2 \, d x + 2 \, c\right )} - i\right )} e^{\left (-d x - c\right )}}{2 \, a d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(d*x+c)^2/(a+I*a*sinh(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(2*d*x*e^(d*x + c) - I*e^(2*d*x + 2*c) - I)*e^(-d*x - c)/(a*d)

________________________________________________________________________________________

Sympy [A]
time = 0.12, size = 78, normalized size = 3.55 \begin {gather*} \begin {cases} \frac {\left (- 2 i a d e^{2 c} e^{d x} - 2 i a d e^{- d x}\right ) e^{- c}}{4 a^{2} d^{2}} & \text {for}\: a^{2} d^{2} e^{c} \neq 0 \\x \left (\frac {\left (- i e^{2 c} + 2 e^{c} + i\right ) e^{- c}}{2 a} - \frac {1}{a}\right ) & \text {otherwise} \end {cases} + \frac {x}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(d*x+c)**2/(a+I*a*sinh(d*x+c)),x)

[Out]

Piecewise(((-2*I*a*d*exp(2*c)*exp(d*x) - 2*I*a*d*exp(-d*x))*exp(-c)/(4*a**2*d**2), Ne(a**2*d**2*exp(c), 0)), (
x*((-I*exp(2*c) + 2*exp(c) + I)*exp(-c)/(2*a) - 1/a), True)) + x/a

________________________________________________________________________________________

Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 41 vs. \(2 (20) = 40\).
time = 0.45, size = 41, normalized size = 1.86 \begin {gather*} \frac {\frac {2 \, {\left (d x + c\right )}}{a} - \frac {i \, e^{\left (d x + c\right )}}{a} - \frac {i \, e^{\left (-d x - c\right )}}{a}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(d*x+c)^2/(a+I*a*sinh(d*x+c)),x, algorithm="giac")

[Out]

1/2*(2*(d*x + c)/a - I*e^(d*x + c)/a - I*e^(-d*x - c)/a)/d

________________________________________________________________________________________

Mupad [B]
time = 0.21, size = 36, normalized size = 1.64 \begin {gather*} \frac {x}{a}-\frac {\frac {{\mathrm {e}}^{c+d\,x}\,1{}\mathrm {i}}{2}+\frac {{\mathrm {e}}^{-c-d\,x}\,1{}\mathrm {i}}{2}}{a\,d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cosh(c + d*x)^2/(a + a*sinh(c + d*x)*1i),x)

[Out]

x/a - ((exp(c + d*x)*1i)/2 + (exp(- c - d*x)*1i)/2)/(a*d)

________________________________________________________________________________________